package ie.wit.loanmanager.model.item;

import ie.wit.loanmanager.exceptions.UnknownItemException;

public class FactoryItem {

	public Item getItem(String typeItem) throws UnknownItemException { 
		
		if (typeItem.equalsIgnoreCase("CD")) {
			return new CD(); 
		}
		
		if (typeItem.equalsIgnoreCase("DVD")) {
			return new DVD(); 
		}
		
		if (typeItem.equalsIgnoreCase("Money")) {
			return new Money(); 
		}
		
		if (typeItem.equalsIgnoreCase("Other")) {
			return new Other(); 
		}
		
		throw new UnknownItemException("Unavailable type of item");
		
	}


	
}
